package com.inkrl.setup.controller;

import com.inkrl.setup.service.SetUpService;
import com.jt.common.pojo.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class SetUpController {
    @Autowired
    private SetUpService setUpService;
    @PostMapping("uaccountCheck")
    public String queryPassword(String upwd, HttpServletRequest request){
        String token = request.getHeader("token");
        String res = setUpService.queryPassword(upwd,token);
        return res;
    }
    @PostMapping("changePassword")
    public String updatePassword(String upwd,HttpServletRequest request){
        String token = request.getHeader("token");
        String res = setUpService.updatePassword(upwd,token);
        return res;
    }
    @PostMapping("addAddress")
    public String addAddress(Address address,HttpServletRequest request){
        String token = request.getHeader("token");
        String res = setUpService.addAddress(address,token);
        return res;
    }
}
